#pragma once
#pragma warning(disable:4996)       // disable checked iterator errors http://msdn.microsoft.com/en-us/library/aa985965(VS.80).aspx 

//
// Copyright (C) 2011 Steve Channell steve.channell@cepheis.com
//
// This file is part of Cephei.QL, an open-source library wrapper 
// arround QuantLib http://quantlib.org/
//
// Cephei.QL is open source software: you can redistribute it and/or modify it
// under the terms of the license.  You should have received a
// copy of the license along with this program; if not, please email
// <support@cepheis.com>. The license is also available online at
// <http://cepheis.com/license.htm>.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE.  See the license for more details.
//
// Version 2.101

#include <Macros.h>
#include <CoVector.h>
#include <CoMatrix.h>
#include <CoCube.h>
#include <ValueHelpers.h>
#include <Settings.h>

#include <gen/QL/StochasticProcess.h>
#pragma unmanaged 
#include <ql\processes\hybridhestonhullwhiteprocess.hpp>
#include <boost/smart_ptr/detail/spinlock.hpp>
#pragma managed 

using namespace System;
using namespace QuantLib;
using namespace Cephei;

using namespace Cephei::QL::Math;
using namespace Cephei::QL;
#define HANDLE
#undef ABSTRACT
#undef STRUCT
namespace Cephei { namespace QL { namespace Processes {
	//////////////////////////////////////////////////////////////////////////////////////////////
	// implementation of IHybridHestonHullWhiteProcess
	public ref class CHybridHestonHullWhiteProcess : 
            public CStochasticProcess,
            public Cephei::QL::Processes::IHybridHestonHullWhiteProcess
	{
	protected: 
		boost::shared_ptr<QuantLib::HybridHestonHullWhiteProcess>* _ppHybridHestonHullWhiteProcess;
#ifdef HANDLE
		QuantLib::Handle<QuantLib::HybridHestonHullWhiteProcess>* _phHybridHestonHullWhiteProcess;
#endif
		Object^ _HybridHestonHullWhiteProcessOwner;     // reference to object that manages the storage for this object
	internal:
		CHybridHestonHullWhiteProcess (Cephei::QL::Processes::IHestonProcess^ hestonProcess, Cephei::QL::Processes::IHullWhiteForwardProcess^ hullWhiteProcess, Double corrEquityShortRate, Microsoft::FSharp::Core::FSharpOption<QL::Processes::HybridHestonHullWhiteProcess::DiscretizationEnum>^ discretization);
        CHybridHestonHullWhiteProcess (boost::shared_ptr<QuantLib::HybridHestonHullWhiteProcess>& childNative, Object^ owner);
        CHybridHestonHullWhiteProcess (QuantLib::HybridHestonHullWhiteProcess& childNative, Object^ owner);
        CHybridHestonHullWhiteProcess (CHybridHestonHullWhiteProcess^ copy);
        CHybridHestonHullWhiteProcess (System::Type^ t);
#ifdef STRUCT
        CHybridHestonHullWhiteProcess (QuantLib::HybridHestonHullWhiteProcess childNative);
#endif       
#ifdef HANDLE
		CHybridHestonHullWhiteProcess (QuantLib::Handle<QuantLib::HybridHestonHullWhiteProcess>& childNative, Object^ owner);
		CHybridHestonHullWhiteProcess (QuantLib::Handle<QuantLib::HybridHestonHullWhiteProcess> childNative);
#endif
		virtual ~CHybridHestonHullWhiteProcess ();
		!CHybridHestonHullWhiteProcess ();

	internal:
		QuantLib::HybridHestonHullWhiteProcess& GetReference ();
		boost::shared_ptr<QuantLib::HybridHestonHullWhiteProcess>& GetShared ();
		QuantLib::HybridHestonHullWhiteProcess* GetPointer ();
        void SetHybridHestonHullWhiteProcess (boost::shared_ptr<QuantLib::HybridHestonHullWhiteProcess> native)
        {
            if (_ppHybridHestonHullWhiteProcess != NULL)
                delete _ppHybridHestonHullWhiteProcess;
            _ppHybridHestonHullWhiteProcess = new boost::shared_ptr<QuantLib::HybridHestonHullWhiteProcess> (native);
            SetStochasticProcess (boost::dynamic_pointer_cast<QuantLib::StochasticProcess> (*_ppHybridHestonHullWhiteProcess));
        }
#ifdef HANDLE
		QuantLib::Handle<QuantLib::HybridHestonHullWhiteProcess>& GetHandle ();
#endif
		virtual bool HasNative () override;
    public:
        property Cephei::QL::Processes::IHestonProcess^ HestonProcess 
        {
		    virtual Cephei::QL::Processes::IHestonProcess^ get () ;
        }
        property Cephei::QL::Processes::IHullWhiteForwardProcess^ HullWhiteProcess 
        {
		    virtual Cephei::QL::Processes::IHullWhiteForwardProcess^ get () ;
        }
		virtual Double Numeraire (Double t, Cephei::QL::Math::IArray^ x) ;
        property Cephei::QL::Processes::IHybridHestonHullWhiteProcess^ Update 
        {
		    virtual Cephei::QL::Processes::IHybridHestonHullWhiteProcess^ get () ;
        }
        property QL::Processes::HybridHestonHullWhiteProcess::DiscretizationEnum Discretization 
        {
		    virtual QL::Processes::HybridHestonHullWhiteProcess::DiscretizationEnum get () ;
        }
        property Double Eta 
        {
		    virtual Double get () ;
        }
        property UInt64 Size 
        {
		    virtual UInt64 get () ;
        }
		virtual Double Time (DateTime date) ;
    };
	//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// Factory class
	public ref class CHybridHestonHullWhiteProcess_Factory : public System::MarshalByRefObject,  public IHybridHestonHullWhiteProcess_Factory
	{
	public:
        virtual IHybridHestonHullWhiteProcess^ Create (Cephei::QL::Processes::IHestonProcess^ hestonProcess, Cephei::QL::Processes::IHullWhiteForwardProcess^ hullWhiteProcess, Double corrEquityShortRate, Microsoft::FSharp::Core::FSharpOption<QL::Processes::HybridHestonHullWhiteProcess::DiscretizationEnum>^ discretization);
    };
   
/*Cephei*/ } /*QL*/ } /*Processes */}
